#ifndef GUI_KEEPER_H
#define GUI_KEEPER_H

#include <MyGUI.h>
#include "Base/StatisticInfo.h"
#include "Base/InputFocusInfo.h"
#include "Input/Win32/ResourceW32Pointer.h"
#include <d3dx9.h>
#include <Windows.h>
#include "sgGUI.h"

namespace wraps
{
    class BaseLayout;
}

namespace sgGUI
{
    typedef wraps::BaseLayout BaseLayout;
    typedef std::map<std::string, wraps::BaseLayout *> LayoutMap;
    class sgGUIKeeper :
        public sgGUI::BaseManager
    {
    public:
        sgGUIKeeper();
        static sgGUIKeeper &Instance();
        virtual void createScene();
        virtual void destroyScene();
        
        void hideAll( );
        void showPanel( std::string &name );
        wraps::BaseLayout *getLayout( const std::string &name );
        template <class Panel>
        Panel *getPanel( std::string &name )
        {
            Panel *panel = (Panel*)getLayout( name );
            return panel;
        }
    private:
        virtual void setupResources();

    private:
        LayoutMap m_layouts;
    };
}

#define guiKeeper sgGUI::sgGUIKeeper::Instance()
#endif